﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net;
using System.Web;
using Microsoft.Web.Mvc.ModelBinding;

namespace MvcApplicationBindersSample.Models {

    [BindRequired]
    public class CreateEditPersonModel {

        [DisplayName("First name")]
        [Required(ErrorMessage = "Please enter a first name.")]
        public string FirstName { get; set; }

        [DisplayName("Last name")]
        [Required(ErrorMessage = "Please enter a last name.")]
        public string LastName { get; set; }

        [DisplayName("Age")]
        [Range(0, Int32.MaxValue, ErrorMessage = "Age must be non-negative.")]
        public int? Age { get; set; }

    }
}
